import api from "@/util/api";

async function findAllRole(pageNo = 1, pageSize = 10, params = {}){

    let resp = await api({
        url: "/rbac-api/api/v1/roles",
        method: "get",
        params: {
            pageNo,
            pageSize,
            ...params
        }
    });
    return resp.data;
}
async function deleteRoleById(ids){
    let resp = await api({
        url: "/rbac-api/api/v1/roles/deleteById",
        method: "delete",
        data: ids

    });
    return resp;
}
async function saveRole(role){
    let resp = await api({
        url: "/rbac-api/api/v1/roles/save",
        method: "post",
        data: role
    });
    return resp;
}
async function updateRole(role){
    let resp = await api({
        url: "/rbac-api/api/v1/roles/update",
        method: "put",
        data: role
    });
    return resp;
}
export {
    findAllRole,
    deleteRoleById,
    saveRole,
    updateRole
}